<template>
	<view class="goods-tabs">
		<view class="integral_box">
			<template v-if="data.show">
				<view class="text">应付：</view>
			</template>
			<view class="integral">{{ data.sum }}积分</view>
		</view>
		<template v-if="data.btn">
			<view class="item_btn" 
            style="background: linear-gradient(to right, #FFD260, #FFA84C);">
            {{ data.btn }}
           </view>
		</template>
		<template v-if="data.theme_btn"  >
			<view class="item_btn" :class="data.type ? 'item_btn_active' : ''" @click="toPage(order_url)">{{ data.theme_btn }}</view>
		</template>
	</view>
</template>
<script>
	export default {
		props: {
			data: {
				type: Object,
				default: {
					order_url: "/pages/order/index",
					show: false,			// 是否显示应付：字眼
					integral: 0,            // 积分
					theme_btn: '',          // 立即兑换按钮
					btn: '',                // 加入购物车
                    type: false             // 是否显示灰色
				}
			}
		},
		components: {},
		data() {
			return {
				order_url: "/pages/order/index",
			};
		},
		computed: {},
		methods: {
			toPage(val) {
				console.log("11",111)
				console.log(val,'val');
				uni.navigateTo({
					url: val
				})
			},
            // 确认按钮
            sure() {
            	this.$emit('sure');
            	// this.show = false;
            }
        },
		beforeCreate() {},
		created() {},
		beforeMount() {},
		mounted() {},
		beforeUpdate() {},
		updated() {},
		beforeDestroy() {},
		destroyed() {},
	};
</script>
<style scoped lang='scss'>
	.goods-tabs {
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 999;
		align-items: center;
		line-height: 96rpx;
		box-shadow: 0px -2px 8px 0px rgba(0,0,0,0.04); 
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
        background-color: #fff;
		.integral_box {
			display: flex;
			justify-content: flex-start;
			flex: 1;
			padding-left: 24rpx;
			.text {
				padding-left: 8rpx;
				font-size: 24rpx;
			}
			.integral {
				font-size: 36rpx;
				font-weight: bold;
				color: #FF5445;
			}
		}

		.item_btn {
			flex: 1;
			text-align: center;
			color: #FFFFFF;
			font-size: 28rpx;
			background: #FF5445;
		}
        .item_btn_active {
            background: #999;
        }
	}
</style>
